#CC=mxmlc
TIMESTAMP= $(shell date +%Y%m%d-%H%M%S)

SOURCE_PATH=\
	    -compiler.source-path src \
	    -compiler.source-path ../vk_api_connection/src

DBG_FLAGS=\
	  -compiler.debug \
	  -define CONFIG::debug true \
	  -define CONFIG::release false

FLAGS= \
       -compiler.optimize \
       -compiler.show-actionscript-warnings \
       -compiler.show-binding-warnings \
       -compiler.show-unused-type-selector-warnings \
       -compiler.strict \
       -compiler.use-resource-bundle-metadata \
       -compiler.verbose-stacktraces \
       -default-size 640 530 \
       -define CONFIG::air false \
       -define CONFIG::appName "'Openlast Radio'" \
       -define CONFIG::appSrcLink "'http://openlast-app.googlecode.com'" \
       -define CONFIG::desktop false \
       -define CONFIG::mobile false \
       -define CONFIG::timeStamp "'$(TIMESTAMP)'" \
       -define CONFIG::version "1.4" \
       -incremental \
       -static-link-runtime-shared-libraries \
       -target-player 11.1 \
       -use-network \
       -warnings \


all:
	$(CC) $(FLAGS) $(DBG_FLAGS) \
		$(SOURCE_PATH) \
		-output bin/openlast-dbg.swf \
		-- src/Main.mxml

release:
	$(CC) $(FLAGS) \
		-define CONFIG::debug false \
		-define CONFIG::release true \
		$(SOURCE_PATH) \
		-output bin/openlast.swf \
		-- src/Main.mxml

tests:
	$(CC) $(FLAGS) $(DBG_FLAGS) \
		$(SOURCE_PATH) \
		-compiler.source-path ../asunit40/as3/src \
		-output bin/tests.swf \
		-- testsrc/MainTest.as

clean:
	rm -rf bin

